/**
 * SPRINGBACK
 * A Java implementation of the Formspring API.
 * 
 * Distributed under the MIT License. See LICENSE for more information.
 */
package com.mattsfarmer.springback;

import org.scribe.eq.DefaultEqualizer;
import org.scribe.http.Request;
import org.scribe.oauth.CallType;
import org.scribe.oauth.Token;

/**
 * @author matt
 *
 */
public class FormspringEqualizer extends DefaultEqualizer {
	public String tuneStringToSign(Request request, String toSign, CallType type) {
		//Formspring does not expect the oauth_callback as a part of the base string.
		//toSign = toSign.replace("oauth_callback%3Doob%26", "");
		System.out.println("Base string: " + toSign);
		return toSign;
	}
	
	public Token parseRequestTokens(String response) {
		response = response.replace("oauth_callback_confirmed=true&", "");
		return super.parseRequestTokens(response);
	}
}
